<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 检测数据类型使用 typeof xxx  或 typeof(xxx)
    let num = 10
    console.log(typeof num)  // number
    let str = 'hello'
    console.log(typeof str)  // string
    let bool = true
    console.log(typeof bool)  // boolean
    let undef
    console.log(typeof undef)  // undefined
    let nullVal = null
    console.log(typeof nullVal)  // object
  </script>
</body>

</html>